﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
using System.Reflection;

/// <summary>
/// Logger 的摘要描述
/// </summary>
public class Logger
{
    public Logger()
    {
        //
        // TODO: 在此加入建構函式的程式碼
        //
    }

    public static void WriteLog(string message)
    {
        string filePath = HttpContext.Current.Server.MapPath(String.Format(@"~\Log\{0:yyyyMMdd}.txt", DateTime.Now));
        using (var sr = new StreamWriter(filePath, true))
        {
            sr.WriteLine(string.Format("{0:HH:mm:ss} {1} \n {2}", DateTime.Now, MethodBase.GetCurrentMethod().Name, message));
        }
    }

    //public static Logger Current = new Logger();
}